* "When Do Mass Labor Strikes Reshape the Public" Replication Code
* Perspectives on Politics
* Alexander Hertel-Fernandez
* ah3467@columbia.edu

* Change directory and load data

* Set working directory with replication files here
* cd 

use "ss.dta", clear

* Start log

log using "popanalysis.log", replace

* Generate averaged variables

egen econliberalism = rmean(minwage_r govreduceineq_r diffinc_r) if minwage_r!=. & govreduceineq_r!=. & diffinc_r!=.
label var econliberalism "Economic Liberalism Scale"

gen voicemechsindex = (voicemechs_12_bin + voicemechs_13_bin + voicemechs_14_bin +  voicemechs_15_bin + voicemechs_16_bin +  voicemechs_17_bin + voicemechs_18_bin + voicemechs_19_bin + voicemechs_20_bin + voicemechs_21_bin + voicemechs_22_bin) / 11
replace voicemechsindex = . if emp!=1

* Standardize outcome variables

foreach var of varlist supportstrikes_r walkoutparticipateindex voicemechsindex publix_interest unioninf_r unionvote_bin {
	egen st`var' = std(`var')
}

* Table 1: Outcome Measures of Labor Attitudes and Actions

sum supportstrikes_r walkoutparticipateindex publix_interest voicemechsindex   unionvote_bin unioninf_r

* Figure 1: Correlations Between Strike Exposure and Labor Interest and Attitudes

foreach var of varlist stsupportstrikes_r stwalkoutparticipateindex stvoicemechsindex stpublix_interest  stunionvote_bin stunioninf_r {
	reg `var' strikecomm_bin i.state,  rob
	estimates store a3`var' 
}

coefplot (a3stsupportstrikes_r, label("Support Strikes")) (a3stwalkoutparticipateindex, label("Actions Taken to Support Strikes")) (a3stvoicemechsindex, label("Interest in Workplace Action"))  (a3stpublix_interest, label("Support for Publix Workers (Clicked Petition)")) (a3stunionvote_bin, label("Union Vote (Non-Union Workers)")) (a3stunioninf_r, label("Support for Labor Movement")), keep(strikecomm_bin) drop(_cons) xline(0) xtitle("OLS Coefficient on Reporting Strikes in Local Community") ylabel("")
graph export "figure1.pdf", replace

* Summarize nearest Stop & Shop store or other store distance from respondent

sum neareststoredist
sum anystorenearestdist

* Figure 2: Distance to Nearest Stop & Shop, Frequency of Shopping at Stop & Shop, and Self-Reported Strike Exposure

binscatter freqshopstopshop_r nearest, absorb(state) name(fig2_a, replace) xtitle("Nearest Stop & Shop Store," "in Miles") ytitle("Frequency of Shopping at Stop & Shop (1-5)")
graph export "fig2_1.pdf", replace

binscatter strikecomm_bin nearest, absorb(state) name(fig2_b, replace) xtitle("Nearest Stop & Shop Store," "in Miles") ytitle("% Respondents Reporting Strike in Local Community")
graph export "fig2_2.pdf", replace

binscatter heardhh nearest, absorb(state) name(fig2_c, replace) xtitle("Nearest Stop & Shop Store," "in Miles") ytitle("% Respondents Reporting Family Encountered Strike")
graph export "fig2_3.pdf", replace

graph combine fig2_a fig2_b fig2_c, col(3)
graph export "/Users/ahertel/Dropbox/Worker Representation Survey/Stop and Shop Strike/Paper/figure2.pdf", replace

* Figure 3: Distance to Nearest Stop & Shop and Predictors of Union Support

reg nearest unionmem_bin knowunionmem_bin polideocons econliberalism party3_3 i.state, rob
coefplot, drop(_cons i.state) xline(0) keep(unionmem_bin knowunionmem_bin polideocons econliberalism party3_3)
graph export "figure3.pdf", replace

* Define demographics

global demos age i.race5 i.hispanic i.gender i.emp i.educ4 i.totfaminc_quart i.polideocons i.partyid unionmem_bin knowunionmem_bin

* Table 2: Reduced Form Estimates of Stop & Shop Strike Exposure

eststo clear

eststo: reg stsupportstrikes_r nearest  i.state, rob
eststo: reg stwalkoutparticipateindex nearest   i.state, rob
eststo: reg stpublix_interest nearest i.state, rob
eststo: reg stvoicemechsindex nearest  i.state, rob
eststo: reg stunionvote_bin nearest  i.state, rob
eststo: reg stunioninf_r nearest   i.state, rob

eststo: reg stsupportstrikes_r nearest $demos i.state, rob
eststo: reg stwalkoutparticipateindex nearest  $demos i.state, rob
eststo: reg stpublix_interest nearest $demos i.state, rob
eststo: reg stvoicemechsindex nearest $demos i.state, rob
eststo: reg stunionvote_bin nearest $demos i.state, rob
eststo: reg stunioninf_r nearest  $demos i.state, rob

esttab using "table2.csv", replace star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalar(singleresults) se

* Table 3: 2SLS Estimates of Stop & Shop Strike Exposure

eststo clear

eststo: ivregress 2sls stsupportstrikes_r (strikecomm_bin=nearest)  i.state, first rob
estat firststage

eststo: ivregress 2sls stwalkoutparticipateindex (strikecomm_bin=nearest)   i.state, first rob
estat firststage

eststo: ivregress 2sls stpublix_interest (strikecomm_bin=nearest)  i.state, first rob
estat firststage

eststo: ivregress 2sls stvoicemechsindex (strikecomm_bin=nearest)  i.state, first rob
estat firststage

eststo: ivregress 2sls stunionvote_bin (strikecomm_bin=nearest)  i.state, first rob
estat firststage

eststo: ivregress 2sls stunioninf_r (strikecomm_bin=nearest)  i.state, first rob
estat firststage

eststo: ivregress 2sls stsupportstrikes_r (strikecomm_bin=nearest) $demos i.state, first rob
estat firststage

eststo: ivregress 2sls stwalkoutparticipateindex (strikecomm_bin=nearest) $demos  i.state, first rob
estat firststage

eststo: ivregress 2sls stpublix_interest (strikecomm_bin=nearest) $demos  i.state, first rob
estat firststage

eststo: ivregress 2sls stvoicemechsindex (strikecomm_bin=nearest) $demos  i.state, first rob
estat firststage

eststo: ivregress 2sls stunionvote_bin (strikecomm_bin=nearest)  $demos i.state, first rob
estat firststage

eststo: ivregress 2sls stunioninf_r (strikecomm_bin=nearest) $demos  i.state, first rob
estat firststage

esttab using "table3.csv", replace star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalar(singleresults) se

* Figure 4: Perceptions of Linked Fate and Interest in Braoder Labor Action and Support

reg stpublix_interest linkedfatestrikes_r $demos i.state, first rob
estimates store publixlf
reg stvoicemechsindex linkedfatestrikes_r $demos i.state, first rob
estimates store voicemlf
reg stunionvote_bin linkedfatestrikes_r $demos i.state, first rob
estimates store unionvotlf
reg stunioninf_r linkedfatestrikes_r $demos i.state, first rob
estimates store unioniflf

coefplot (publixlf, label("Outcome is Clicked Publix Petition")) (voicemlf, label("Outcome is Interest in Worplace Action")) (unionvotlf, label("Outcome is Vote for Union at Job")) (unioniflf, label("Outcome is Support More Union Influence")), xline(0) keep(linkedfatestrikes_r) ylabel("") xtitle("OLS Coefficient on Linked Fate with Strikes (1-3)")
graph export "figure4.pdf", replace

* Table 4: Exploring Reduced Form and 2SLS Effects of Strikes on Perceptions of Linked Fate

eststo clear

eststo: reg linkedfatestrikes_r nearest $demos  i.state, rob
eststo: ivregress 2sls linkedfatestrikes_r (strikecomm_bin=nearest)  $demos i.state, first rob
estat firststage 

esttab using "table4.csv", replace star(+ 0.10 * 0.05 ** 0.01 *** 0.001) scalar(singleresults) se

* Appendix Figure C1: Distance to Nearest Other Grocery or Big Box Store, Frequency of Shopping at Stop & Shop (Left) and Self-Reported Strike Exposure (Right)

binscatter freqshopstopshop_r anystorenearestdist, absorb(state) ytitle("Frequency of Shopping at Stop & Shop (1-5)") xtitle("Nearest Other Store, in Miles") name(c1_a, replace)
binscatter strikecomm_bin anystorenearestdist , absorb(state) ytitle("% Respondents Reporting Strike in Local Community") xtitle("Nearest Other Store, in Miles") name(c1_b, replace)

graph combine c1_a c1_b
graph export "appendix_figurec1.pdf", replace

* Appendix Figure E1: 2SLS Estimates of the Effect of Strike Exposure on Different Forms of Actions Taken in Support of the Stop & Shop Strike

foreach var of varlist walkoutparticipate_1_r walkoutparticipate_7_r walkoutparticipate_2_r walkoutparticipate_3_r walkoutparticipate_4_r{
		ivregress 2sls `var' (strikecomm_bin=nearest) $demos i.state, first rob
		estimates store ivwp`var'
}
coefplot (ivwpwalkoutparticipate_1_r, label("Boycotted Stop & Shop")) (ivwpwalkoutparticipate_7_r, label("Told Others to Boycott Stop & Shop")) (ivwpwalkoutparticipate_2_r, label("Held Signs, Marched, or Joined Protests")) (ivwpwalkoutparticipate_3_r, label("Brought Food to Strikers")) (ivwpwalkoutparticipate_4_r, label("Donated Money to Strikers")), xline(0) keep(strikecomm_bin) ylabel("")
graph export "appendix_figuree1.pdf", replace

* Appendix Figure F1: 2SLS Estimates of the Effect of Strike Exposure on Interest in Workplace Actions, Among Employed Respondents

foreach var of varlist voicemechs_12_bin voicemechs_13_bin voicemechs_14_bin voicemechs_15_bin voicemechs_16_bin voicemechs_17_bin voicemechs_18_bin voicemechs_19_bin voicemechs_20_bin voicemechs_21_bin voicemechs_22_bin{
		ivregress 2sls `var' (strikecomm_bin=nearest) $demos i.state, first rob
		estimates store ivvm`var'
}

coefplot (ivvmvoicemechs_12_bin, label("Have Conversation with Manager")) (ivvmvoicemechs_13_bin, label("Get Advice From Coworker")) (ivvmvoicemechs_14_bin, label("File Complaint or Grievance")) (ivvmvoicemechs_15_bin, label("Join Committee of Employees and Managers")) (ivvmvoicemechs_16_bin, label("Join Worker Organization")) (ivvmvoicemechs_17_bin, label("Sign Petition to Managers"))  (ivvmvoicemechs_19_bin, label("Join Association to Address Workplace Issue")) (ivvmvoicemechs_20_bin, label("Join Affinity Group")) (ivvmvoicemechs_21_bin, label("Join Protest or Rally")) (ivvmvoicemechs_22_bin, label("Go on Strike")) (ivvmvoicemechs_18_bin, label("Use Online Community")), ylabel("") xline(0) keep(strikecomm_bin)
graph export "appendix_figuref1.pdf", replace

* Close log

log close








